classdef cSoftmax
    properties
        beta;
    end
    
    methods
        function obj = cSoftmax(init_beta)
            obj.beta=init_beta;
        end

        function [obj] = setParam(obj,param)
            obj.beta=param;
        end
        
        function [arm] = getArm(obj,Q)
            k=length(Q);
            p=exp(Q*obj.beta) / sum(exp(Q*obj.beta));
            arm=sum(mnrnd(1,p).*(1:k));
        end
        
    end
    
end